
/**
 *	
 */
class AA{
	public String string(Object a) {return "AA"; }
}
class BB extends AA {
	public String string(Object a) {return "BB"; }
}
class CC extends BB{
	public String string(Object a) {return "CC"; }
}
class DD extends CC{
	public String string(Object a) {return "DD"; }
}
public class ExtendsDemo {

	public static void main(String[] args) {
		AA a = new AA();
		BB b = new BB();
		CC c = new CC();
		DD d = new DD();
		
		//print( a.string(b) );
		//print( a.string(c) );
		//print( a.string(d) );
		
		print( b.string(a) );
		//print( b.string(c) );
		//print( b.string(d) );
		
		//print( c.string(a) );
		//print( c.string(b) );
		//print( c.string(d) );
		
	}
	
	public static void print(String str){
		System.out.println(str);
	}

}
